package com.imooc.bilibili.service;

import com.alibaba.fastjson.JSONObject;
import com.imooc.bilibili.entity.LoginInfo;
import com.imooc.bilibili.entity.UserInfo;
import com.imooc.bilibili.entity.page.PageResult;
import com.imooc.bilibili.request.UserRequest;

import java.util.List;
import java.util.Map;


public interface UserService {
    void insertUserService(UserRequest req);

    String loginUserService(LoginInfo loginInfo);

    UserInfo getUserInfoService(Long currnetUserId);

    void updateUserInfoService(UserRequest request);

    UserInfo queryUserByIdService(Long followingId);

    List<UserInfo> getUserInfoByIdsService(List<Long> follwingIds);

    List<UserInfo> getUserInfoByUserIdsService(List<Long> userIds);

    PageResult<UserInfo> getUserInfoPageService(JSONObject params);

    /**
     * 双token登录接口返回
     * @param loginInfo
     * @return
     */
    Map<String, String> loginUserDtsService(LoginInfo loginInfo);

    /**
     * 退出登录，删除refreshToken
     * @param refreshToken
     * @param userId
     */
    void logoutService(String refreshToken, Long userId);

    /**
     * 使用refreshToken刷新accessToken
     * @param refreshToken
     * @return
     */
    String refreshAccessToken(String refreshToken);
}
